# data = [1, 2, 3, 4, 5, 6]
# # 定义最终需要的数据的变量
# data_sum = 0
# data_max = None
# data_min = None
# # 列表访问的索引值
# i = 0
# # 列表的长度
# l = len(data)
# while i < l:
#     data1 = data[i]
#     data_sum = data_sum + data1
#     if data_max == None or data_max < data1:
#         data_max = data1
#     if data_min == None or data_min > data1:
#         data_min = data1
#     i += 1
# data_avg = data_sum / l
# print(data_sum, data_max, data_min, data_avg)


# 打印图案
# for i in range(5):
#     for j in range(5):
#         print("*", end="  ")
#     print()

# for i in range(5):
#     for j in range(i+1):
#         print("*", end=" ")
#     print()
#
# for i in range(5, 0, -1):
#     for j in range(i):
#         print("*", end=" ")
#     print()
#
# for i in range(5, 0, -1):
#     for j in range(i-1):
#         print(" ", end=" ")
#     for k in range((5-i)*2+1):
#         print("*", end=" ")
#     print()

text = """
Python is a popular programming language. It is widely used for web development, data science, and more.
Python has a simple and readable syntax, which makes it great for beginners.
"""
words = text.lower().split()
words_num = {}
for w in words:
    word = w.strip("")
    if word in words_num:
        words_num[word] += 1
    else:
        words_num[word] = 1
print(words_num)
for k,v in words_num.items():
    print(f"{k}:{v}")











